Skip to content

Conversation

@syphar
Copy link
Member

@syphar syphar commented Nov 1, 2025

This comes for

  1. some race conditions with index files I want to solve. This will get more with other changes I have planned.
  2. the ability to later add cleanup for the local caches, without affecting requests, if we need that

Also, every now and then I manually wipe the cache, and let the server re-download the files when they are accessed.

When I do that, we see regular sqlite "database image is malformed" errors, likely because of a race condition between the index download, rename and continous requests happening. All the time following requests on the same URLs that had these errors work fine.

The shared RwLock protects us here. Downside is that requests will queue up until the first request downloaded the archive index, and then continue. But IMO this is good behaviour.

@syphar syphar self-assigned this Nov 1, 2025
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Nov 1, 2025
@syphar syphar added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 3, 2025
@syphar syphar force-pushed the archive-file-lock branch 3 times, most recently from 0edfa0e to 32c3e94 Compare November 14, 2025 09:35
@syphar syphar changed the title WIP: introduce locking to manage access & download of archive index, prune unused indexes introduce locking to manage access & download of archive index Nov 14, 2025
@syphar syphar marked this pull request as ready for review November 14, 2025 09:44
@syphar syphar requested a review from a team as a code owner November 14, 2025 09:44
@syphar syphar added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Nov 14, 2025
Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I think the read/write locks API definitely should be improved, we didn't yet come up with a better API. I'll try to dive into it later on.

@syphar syphar merged commit 1c94e2f into rust-lang:master Nov 14, 2025
10 checks passed
@syphar syphar deleted the archive-file-lock branch November 14, 2025 15:51
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 14, 2025
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants